import request from '@/router/axios';

export const getInventoryList = (params) => {
    return request({
        url: '/api/mes-admin/inventory/query-list',
        method: 'get',
        params: {
            ...params,
        }
    })
}

export const getAreaTree = (params) => {
    return request({
        url: '/api/mes-admin/area/lazy-list',
        method: 'get',
        params: {
            ...params
        }
    })
}

export const getAreaTreeByInventoryId = (params) => {
    return request({
        url: '/api/mes-admin/area/tree',
        method: 'get',
        params: {
            ...params
        }
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/mes-admin/area/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const remove = (ids) => {
    return request({
        url: `/api/mes-admin/area/remove?ids=${ids}`,
        method: 'post',
    })
}

export const add = (row) => {
    return request({
        url: '/api/mes-admin/area/submit',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/mes-admin/area/submit',
        method: 'post',
        data: row
    })
}

//打印
export const print = (row) => {
    return request({
        url: '/api/mes-admin/area/print',
        method: 'post',
        data: row
    })
}

